import request from '@/utils/request'

export function getTasskList(params) {
  return request({
    url: '/api/task-service/task/search',
    params
  })
}

export function getTaskInfo(id) {
  return request({
    url: `/api/task-service/task/taskInfo/${id}`
  })
}

export function createTask(data) {
  return request({
    method: 'POST',
    url: '/api/task-service/task/create',
    data
  })
}

export function getUserList(params) {
  return request({
    url: '/api/user-service/user/search',
    params
  })
}

export function cancelTask(data) {
  return request({
    url: `/api/task-service/task/cancel/${data.taskId}`,
    method: 'POST',
    data
  })
}
